fvscope — Scope of a function's arguments
The fvscope
function allows you to determine what variables are
used in a function, and what their scope is. The first argument is
the name of the function that you wish to examine, and the optional
second argument allows you to specify a file to write the resulting
analysis to.
fvscope
is useful for writing general purpose functions that
will be used by others. It can be used to identify errant
global variables (variables that should be local, but were
overlooked).
Note that the line numbers in the first part of the example are all 1.
This is a result of entering the function at the command line. If you
are using a function from a file, as in the second and third examples, the
numbers come out right.
Subsections